#ifndef CDEF_H_
#define CDEF_H_

typedef unsigned char	bool;

typedef unsigned char	uint8;
typedef unsigned short	uint16;
typedef unsigned long	uint32;

typedef signed char		int8;
typedef signed short	int16;
typedef signed long		int32;

typedef void 			(*tFuncPtr)(void); 

#define true			((bool)(1==1))
#define false 			((bool)(1==0))

typedef union
{
	uint8 value;
	struct
	{
		uint8 b0 :1;
		uint8 b1 :1;
		uint8 b2 :1;
		uint8 b3 :1;
		uint8 b4 :1;
		uint8 b5 :1;
		uint8 b6 :1;
		uint8 b7 :1;
	} bits;
} uint8_bits;

typedef union
{
	uint16 value;
	uint8 v[2];
	struct
	{
		uint8 lb;
		uint8 hb;
	} byte;
	struct
	{
		uint8 b0  :1;
		uint8 b1  :1;
		uint8 b2  :1;
		uint8 b3  :1;
		uint8 b4  :1;
		uint8 b5  :1;
		uint8 b6  :1;
		uint8 b7  :1;
		uint8 b8  :1;
		uint8 b9  :1;
		uint8 b10 :1;
		uint8 b11 :1;
		uint8 b12 :1;
		uint8 b13 :1;
		uint8 b14 :1;
		uint8 b15 :1;
	} bits;
} uint16_bits;

#endif
